package com.lyf.controller;

import com.lyf.service.HystrixTestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @AUTHOR LYF
 * @DATE 2022/2/6
 * @VERSION 1.0
 * @DESC
 */
@RestController
public class HystrixTestController {
    @Resource
    HystrixTestService hystrixTestService;


    @GetMapping("/payment/ok")
    String paymentOk(){
        return hystrixTestService.paymentOk();
    }

    @GetMapping("/payment/timeout")
    String paymentTimeOk() throws InterruptedException {
        return hystrixTestService.paymentTimeOut();
    }

}
